	<% @page_heading = _('Blog settings') %>

	<% form_tag :action => 'update' do %>

	<div class="tasks">
		<h3><%= _("Which settings group would you like to edit")%>?</h3>
    	<ul>
      		<li><a href="#gensettings" onclick="new Effect.ScrollTo('gensettings'); return false"><%= _("General Settings")%></a></li>
      		<li><a href="#read" onclick="new Effect.ScrollTo('read'); return false"><%= _("Read")%></a></li>
      		<li><a href="#write" onclick="new Effect.ScrollTo('write'); return false"><%= _("Write")%></a></li>
      		<li><a href="#discuss" onclick="new Effect.ScrollTo('discuss'); return false"><%= _("Discuss")%></a></li>
      		<li><a href="#notification" onclick="new Effect.ScrollTo('notification'); return false"><%= _("Notification")%></a></li>
      		<li><a href="#spam" onclick="new Effect.ScrollTo('spam'); return false"><%= _("Spam Protection")%></a></li>
      		<li><a href="#resources" onclick="new Effect.ScrollTo('resources'); return false"><%= _("Resource Settings")%></a></li>
      		<li><a href="#misc" onclick="new Effect.ScrollTo('misc'); return false"><%= _("Cache")%></a></li>
    	</ul>
    <p style="clear:both;"></p>
  </div>

<div class="admin">
	<fieldset id="gensettings" class="set" style="margin-top:10px;">
		<legend><%= _("General settings")%></legend>

		<ul>
			<li>
				<label for="blog_name" class="float"><%= _("Blog name")%>:</label>
				<input name="setting[blog_name]" id="blog_name" type="text" value="<%=h this_blog.blog_name %>" size="<%= this_blog.blog_name.length %>" />
			</li>
			<li>
				<label class="float" for="blog_subtitle"><%= _("Blog subtitle")%>:</label>
				<input name="setting[blog_subtitle]" id="blog_subtitle" type="text" value="<%=h this_blog.blog_subtitle %>" size="<%= this_blog.blog_subtitle.length%>" />
		    </li>
			<li>
				<label class="float" for="base_url"><%= _("Blog URL")%>:</label>
				<input name="setting[base_url]" id="base_url" type="text" value="<%=h this_blog.base_url %>" size="<%= this_blog.base_url.length %> " />
			</li>
			<li>
				<label class="float" for="geourl_location"><%= _("Latitude, Longitude")%>:</label>
				<input name="setting[geourl_location]" size="20" id="geourl_location" type="text" value="<%= this_blog.geourl_location %>" />
				<span class="float"><%= _("Display")%> <a href="http://geourl.org"><%= _("your lattitude and longitude")%></a> (<%= _("exemple")%> <tt>47.774,-122.201</tt>)</span>
			</li>
			<li>
				<label class="float"><%= _("Show blog name")%>:</label>
				<input type="radio" name="setting[title_prefix]" value="1" id="blog_title_prefix_1" <%= 'checked="checked"' if this_blog.title_prefix == 1 %>/>
				<label for="blog_title_prefix_1"><%= _("At the beginning of page title")%></label>
				<span class="float">
					<input type="radio" name="setting[title_prefix]" value="2" id="blog_title_prefix_2" <%= 'checked="checked"' if this_blog.title_prefix == 2 %>/>
					<label for="blog_title_prefix_2"><%= _("At the end of page title")%></label>
				</span>
				<span class="float">
					<input type="radio" name="setting[title_prefix]" value="0" id="blog_title_prefix_0" <%= 'checked="checked"' if this_blog.title_prefix == 0 %>/>
				    <label for="blog_title_prefix_0"><%= _("Don't show blog name in page title")%></label>
				</span>
		  	</li>
		</ul>
    	<p class="r"><%= save(_("Save Settings")) %></p>
  	</fieldset>

	<fieldset id="read" class="set">
		<legend><%= _("Read")%></legend>

		<ul>
			<li>
				<label for="limit_article_display" class="float"><%= _("Display")%> </label>
				<input name="setting[limit_article_display]" size="4" id="limit_article_display" type="text" value="<%= this_blog.limit_article_display %>" />
				<%= _("articles on my homepage by default")%>
			</li>
			<li>
			    <label for="limit_rss_display" class="float"><%= _("Display")%> </label>
			    <input name="setting[limit_rss_display]" size="4" id="limit_rss_display" type="text" value="<%= this_blog.limit_rss_display %>" />
				<%= _("articles in my news feed by default")%>.
			</li>
			<li class="checkbox">
				<label class="float" for="show_extended_on_rss"><%= _("Show full article on feed")%>:</label>
			    <input name="setting[show_extended_on_rss]" id="show_extended_on_rss" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.show_extended_on_rss%> />
			    <input name="setting[show_extended_on_rss]" type="hidden" value="0" />
			</li>
		</ul>
	  <p class="r"><%= save(_("Save Settings")) %></p>
	</fieldset>

	<fieldset id="write" class="set">
		<legend><%= _("Write")%></legend>
		<ul>
			<li>
				<label class="float"><%= _("Editor")%>:</label>
				<input type="radio" name="setting[editor]" value="2" id="editor_2" <%= 'checked="checked"' if this_blog.editor == 2 %>/>
				<label for="editor_2"><%= _("Use visual rich editor")%></label>
				<span class="float">
					<input type="radio" name="setting[editor]" value="1" id="editor_1" <%= 'checked="checked"' if this_blog.editor == 1 %>/>
					<label for="editor_1"><%= _("Use simple editor with live preview (default)")%></label>
				</span>
				<span class="float">
					<input type="radio" name="setting[editor]" value="0" id="editor_0" <%= 'checked="checked"' if this_blog.editor == 0 %>/>
				    <label for="editor_0"><%= _("Use simple editor without live preview")%></label>
				</span>
		  	</li>

			<li>
		        <label class="float" for="text_filter"><%= _("Article filter")%>:</label>
		        <select name="setting[text_filter]" id="text_filter">
		          <%= options_for_select text_filter_options, TextFilter.find_by_name(this_blog.text_filter) %>
		        </select>
			</li>
			<li>
				<label for="comment_text_filter" class="float"><%= _("Comments filter")%>:</label>
		        <select name="setting[comment_text_filter]" id="comment_text_filter">
		        <%= options_for_select text_filter_options, TextFilter.find_by_name(this_blog.comment_text_filter) %>
		        </select>
			</li>
			<li>
				<%= _("When publishing articles, Typo can send trackbacks to websites that you link to. This should be disabled for private blogs as it will leak non-public information to sites that you're discussing. For public blogs, there's no real point in disabling this.")%>
			</li>
			<li class="checkbox">
	          <label class="float" for="send_outbound_pings"><%= _("Send trackbacks")%>:</label>
		      <input name="setting[send_outbound_pings]" id="send_outbound_pings" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.send_outbound_pings%> />
	         <input name="setting[send_outbound_pings]" type="hidden" value="0" />
			</li>
			<li>
				<label class="float" for="ping_urls"><%= _("URLs to ping automatically")%>:</label>
		      	<textarea name="setting[ping_urls]" id="ping_urls" rows="5" cols="50"><%=h this_blog.ping_urls %></textarea>
			</li>
		</ul>
		<p class="r"><%= save(_("Save Settings")) %></p>
	</fieldset>

	<fieldset id="discuss" class="set">
		<legend><%= _("Discuss")%></legend>
		<ul>
			<li>
				<%= _("This setting allows you to disable trackbacks for every article in your blog.  It won't remove existing trackbacks, but it will prevent any further attempt to add a trackback anywhere on your blog.")%>
			</li>
			<li class="checkbox">
				<label class="float" for="global_pings_disable"><%= _("Disable trackbacks site-wide")%>:</label>
				<input name="setting[global_pings_disable]" id="global_pings_disable" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.global_pings_disable%> />
				<input name="setting[global_pings_disable]" type="hidden" value="0" />
			</li>
			<li class="checkbox">
		        <label class="float" for="default_allow_pings"><%= _("Enable Trackbacks by default")%>:</label>
		      	<input name="setting[default_allow_pings]" id="default_allow_pings" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_allow_pings%> />
		      	<input name="setting[default_allow_pings]" type="hidden" value="0" />
			</li>
			<li><%= _("You can enable site wide comment moderation. If you do so, no comment or trackback will appear on your blog unless you validate it")%>.</li>
			<li class="checkbox">
				<label class="float" for="default_moderate_comments"><%= _("Enable comments moderation")%>:</label>
				<input name="setting[default_moderate_comments]" id="default_moderate_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_moderate_comments %> />
				<input name="setting[default_moderate_comments]" type="hidden" value="0" />
			</li>
			<li class="checkbox">
	        	<label class="float" for="default_allow_comments"><%= _("Enable comments by default")%>:</label>
				<input name="setting[default_allow_comments]" id="default_allow_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_allow_comments%> />
		      	<input name="setting[default_allow_comments]" type="hidden" value="0" />
			</li>
			<li class="checkbox">
				<label class="float" for="link_to_author"><%= _("Show your email address") %>:</label>
				<input name="setting[link_to_author]" id="link_to_author" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.link_to_author%> />
				<input name="setting[link_to_author]" type="hidden" value="0" />
			</li>
			<li class="checkbox">
		      <label class="float" for="use_gravatar"><%= _("Enable gravatars")%>:</label>
		      <input name="setting[use_gravatar]" id="use_gravatar" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.use_gravatar %> />
		      <input name="setting[use_gravatar]" type="hidden" value="0" />
			</li>
			<li>
				<%= _("You can optionally disable non-Ajax comments. Typo will always use Ajax for comment submission if Javascript is enabled, so non-Ajax comments are either from spammers or users without Javascript.")%>
			</li>
			<li class="checkbox">
				<label for="sp_allow_non_ajax_comments" class="float"><%= _("Allow non-ajax comments") %>:</label>
	          	<input name="setting[sp_allow_non_ajax_comments]" id="sp_allow_non_ajax_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.sp_allow_non_ajax_comments%> />
	          	<input name="setting[sp_allow_non_ajax_comments]" type="hidden" value="0" />
			</li>
			<li>
				<label for="sp_article_auto_close" class="float"><%= _("Disable comments after")%></label>
				<input name="setting[sp_article_auto_close]" size="4" id="sp_article_auto_close" type="text" value="<%= this_blog.sp_article_auto_close %>" /> <%= _("days") %>
				<span class="float"><%= _("Set to 0 to never disable comments")%></span>
			</li>
			<li>
				<p><%= _("Typo will automatically reject comments and trackbacks which contain over a certain amount of links in them")%>.</p>
				<label class="float" for="sp_url_limit"><%= _("Max Links")%>:</label>
	          	<input name="setting[sp_url_limit]" size="4" id="sp_url_limit" type="text" value="<%= this_blog.sp_url_limit %>" />
	          	<span class="float"><%= _("Set to 0 to never reject comments")%></span>
			</li>
		</ul>

      <p class="r"><%= save(_("Save Settings")) %></p>
	</fieldset>

	<fieldset id="notification" class="set">
		<legend><%= _("Notification")%></legend>
		<ul>
			<li><%= _("Typo can notify you when new articles or comments are posted")%></li>
			<li>
				<label class="float" for="email_from"><%= _("Source Email")%>:</label>
				<input name="setting[email_from]" size="25" id="email_from" type="text" value="<%= this_blog.email_from %>" />
				<span class="float"><%= _("Email address used by Typo to send notifications")%>.</span>
			</li>
			<li>
				<label for="jabber_address" class="float"><%=_("Jabber account")%>:</label>
				<input name="setting[jabber_address]" size="20" id="jabber_address" type="text" value="<%= this_blog.jabber_address %>" />
				<span class="float"><%= _("Jabber account to use when sending Jabber notifications") %>.</span>
			</li>
			<li>
				<label class="float" for="jabber_password"><%= _("Jabber password")%>:</label>
		      	<input name="setting[jabber_password]" size="20" id="jabber_password" type="password" value="<%= this_blog.jabber_password %>" />
			</li>
		</ul>
      <p class="r"><%= save(_("Save Settings")) %></p>
	</fieldset>

	<fieldset id="spam" class="set">
		<legend><%= _("Spam protection")%></legend>

		<ul>
			<li><%= _("Enabling spam protection will make typo compare the IP address of posters as well as the contents of their posts against local and remote blacklists. Good defense against spam bots")%>.</li>
			<li class="checkbox">
				<label for="sp_global" class="float"><%= _("Enable spam protection")%>:</label>
				<input name="setting[sp_global]" id="sp_global" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.sp_global%> /><input name="setting[sp_global]" type="hidden" value="0" />
			</li>
			<li><%= _("Typo can (optionally) use the %s spam-filtering service.  You need to register with Akismet and receive an API key before you can use their service.  If you have an Akismet key, enter it here", '<a href="http://akismet.com">Akismet</a>')%> .
			</li>
			<li>
				<label class="float" for="sp_akismet_key"><%= _("Akismet Key")%>:</label>
				<input name="setting[sp_akismet_key]" id="sp_akismet_key" type="text" value="<%=h this_blog.sp_akismet_key %>" />
			</li>
		</ul>
        <p class="r"><%= save(_("Save Settings")) %></p>
	</fieldset>

	<fieldset id="resources" class="set">
		<legend><%= _("Resource Settings")%></legend>
		<ul>
			<li><%= _("The below settings act as defaults when you choose to publish an enclosure with iTunes metadata")%>.</li>
			<li>
				<label for="itunes_author" class="float"><%= _("Author")%>:</label>
	          	<input name="setting[itunes_author]" size="25" id="itunes_author" type="text" value="<%= this_blog.itunes_author %>" />
			</li>
			<li>
	          	<label for="itunes_subtitle" class="float"><%= _("Subtitle")%>: <span class="mandatory">*</span></label>
	          	<input name="setting[itunes_subtitle]" size="25" id="itunes_subtitle" type="text" value="<%= this_blog.itunes_subtitle %>" />
			</li>
			<li>
				<label class="float" for="itunes_summary"><%= _("Summary")%>: <span class="mandatory">*</span></label>
				<textarea name="setting[itunes_summary]" cols="40" rows="3"><%=h this_blog.itunes_summary %></textarea>
				<span class="float mandatory">* <%= _("Setting for channel")%></span>
			</li>
			<li>
	          <label class="float" for="itunes_email"><%= _("Email")%>: <span class="mandatory">**</span></label>
	          <input name="setting[itunes_email]" size="25" id="itunes_email" type="text" value="<%= this_blog.itunes_email %>" />
			</li>
			<li>
				<label class="float" for="itunes_name"><%= _("Optional Name")%>: <span class="mandatory">**</span></label>
				<input name="setting[itunes_name]" size="25" id="itunes_name" type="text" value="<%= this_blog.itunes_name %>" />
				<span class="float mandatory">** <%= _("Not published by Apple")%></span>
			</li>
			<li>
				<label class="float" for="itunes_copyright"><%= _("Copyright Information")%>:</label>
	          	<input name="setting[itunes_copyright]" size="25" id="itunes_copyright" type="text" value="<%= this_blog.itunes_copyright %>" />
			</li>
			<li class="checkbox">
				<label class="float" for="itunes_explicit"><%= _("Explicit")%>:</label>
	          	<input name="setting[itunes_explicit]" id="itunes_explicit" type="checkbox"  value="1" <%= 'checked="checked"' if this_blog.itunes_explicit%> />
				<input name="setting[itunes_explicit]" type="hidden" value="0" />
			</li>
		</ul>
        <p class="r"><%= save(_("Save Settings")) %></p>
	</fieldset>

	<fieldset id="misc" class="set">
		<legend><%= _("Cache")%></legend>
		<ul>
			<li><%= link_to _('Empty Fragment Cache'), :controller => '/admin/cache', :action => 'sweep' %></li>
			<li><%= link_to _('Rebuild cached HTML'), :controller => '/admin/cache', :action => 'sweep_html' %></li>
	     	<p id="users"><%= _("There are %d entries in the cache", @page_cache_size) %></p>
		</ul>
	</fieldset>

	<div id="operations" class="tasks">
    <%= save(_("Save Settings")) %>
  </div>
</div>
  <% end %>
